package cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.controller;

import cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.entity.Conference;
import cn.edu.sdjzu.xg.eagle.xg23_kcsj_01.service.ConferenceService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * @author 张烁瑜
 * @Date 2025/5/21 15:55
 */
@RestController
@RequestMapping("/conference")
public class ConferenceController {

    @Autowired
    private ConferenceService conferenceService;

    @PostMapping
    public String save(@RequestBody Conference conference) {
        return conferenceService.save(conference);
    }

    @PutMapping
    public String update(@RequestBody Conference conference) {
        return conferenceService.update(conference);
    }

    @DeleteMapping("/{conferenceId}")
    public String delete(@PathVariable Long conferenceId) {
        return conferenceService.delete(conferenceId);
    }
    @GetMapping
    public PageInfo<Conference> get(int pageNum, int pageSize, Conference conference) {
        return conferenceService.get(pageNum,pageSize,conference);
    }
}
